<template>
     <div class="banner">
        <div class="swiper-container">
            <div class="swiper-wrapper">
                <slot></slot>
                
            </div>
            <!-- 如果需要分页器 -->
            <div class="swiper-pagination"></div>
            
            <!-- 如果需要导航按钮 -->
            <!-- <div class="swiper-button-prev">
              <i class="iconfont icon-lunboyoufangun"></i>
            </div>
            <div class="swiper-button-next"></div> -->
            
            <!-- 如果需要滚动条 -->
            <!-- <div class="swiper-scrollbar"></div> -->
        </div>
    </div>
</template>


<script>
import Swiper from 'swiper';
import 'swiper/css/swiper.min.css'

export default {
    data() {
        return {

        }
    },
    updated() {
          new Swiper ('.swiper-container', {
            // direction: 'vertical', // 垂直切换选项
            loop: true, // 循环模式选项
            
            // 如果需要分页器
            pagination: {
            el: '.swiper-pagination',
            },
            
            // // 如果需要前进后退按钮
            // navigation: {
            // nextEl: '.swiper-button-next',
            // prevEl: '.swiper-button-prev',
            // },
            
           
            autoplay: {
	        delay: 2500,
	        disableOnInteraction: false,
	      },
        })        
     },
}
</script>


<style scoped>
     html,
    body {
      position: relative;
      height: 100%;
    }

    body {
      background: #eee;
      font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
      font-size: 14px;
      color: #000;
      margin: 0;
      padding: 0;
    }

    .swiper {
      width: 100%;
      height: 100%;
    }

    .swiper-slide {
      text-align: center;
      font-size: 18px;
      background: #fff;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .swiper-slide img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

   .swiper-container .swiper-pagination-bullet-active{
        background: red;
    }
    
</style>